package com.hw.backapi.controller;

import com.hw.common.contants.RedisKeyContants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lipeng
 * @description 测试
 * @date 2023/5/17 15:05
 */
@RestController
@RequestMapping("/test/")
public class TestController {

    @Autowired
    StringRedisTemplate stringRedisTemplate;

    @GetMapping("redis")
    public void reids1(){
        stringRedisTemplate.opsForValue().set(RedisKeyContants.BASE_PREFIX + "testredis1","re");

        System.out.println(stringRedisTemplate.opsForValue().get(RedisKeyContants.BASE_PREFIX + "testredis1"));
    }
}
